﻿# Project Name
PROJECTNAME = Install

# File Name
MAKEFILENAME = makefile

# Machine Type
PRO_MACHINE_TYPE = x86e_win64

# Executable names
EXE = $(PROJECTNAME).exe


CPP_SRC = $(MAKEDIR)
APP_ROOT = E:\\creo-secondary-development

#C:\Program Files (x86)\Windows Kits\8.0\Include
SYS_INCLUDE = C:/Progra~2/WI3CF2~1/8.0/Include
#C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC
VS_INCLUDE = C:/Progra~2/MICROS~3.0/VC

# Include File Paths
INCS = -I. 								\
		-I$(VS_INCLUDE)/include			\
		-I$(SYS_INCLUDE)/um				\
		-I$(SYS_INCLUDE)/shared			\
		-I$(APP_ROOT)/includes/			\
		-I$(APP_ROOT)/includes/Logger

# Compiler Flags
CC = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64\cl.exe"
# CC = cl
DEBUG = /Zi
MACH = -DPRO_MACHINE=36 -DPRO_OS=4
# CCFLAGS = -c -GS -fp:precise -DUSE_ANSI_IOSTREAMS -DPRO_USE_VAR_ARGS /EHsc $(DEBUG)
# CCFLAGS = -c -GS -fp:strict /EHsc /O2 $(DEBUG)
CCFLAGS = -c -GS -fp:precise /EHsc
CFLAGS = $(CCFLAGS) $(INCS) $(MACH)

# Libraries
#C:\Program Files (x86)\Windows Kits\8.0
LIB_PATH = C:/Progra~2/WI3CF2~1/8.0/Lib/win8
LIBS = \
		$(VS_INCLUDE)/lib/amd64/libcpmt.lib		\
		$(VS_INCLUDE)/lib/amd64/libcmt.lib		\
		$(VS_INCLUDE)/lib/amd64/oldnames.lib	\
		$(LIB_PATH)/um/x64/uuid.lib				\
		$(LIB_PATH)/um/x64/kernel32.lib  
		
# $(LIB_PATH)/um/x64/user32.lib   \
# $(LIB_PATH)/um/x64/wsock32.lib  \
# $(LIB_PATH)/um/x64/advapi32.lib \
# $(LIB_PATH)/um/x64/mpr.lib      \
# $(LIB_PATH)/um/x64/winspool.lib \
# $(LIB_PATH)/um/x64/netapi32.lib \
# $(LIB_PATH)/um/x64/psapi.lib    \
# $(LIB_PATH)/um/x64/gdi32.lib    \
# $(LIB_PATH)/um/x64/shell32.lib  \
# $(LIB_PATH)/um/x64/comdlg32.lib \
# $(LIB_PATH)/um/x64/ole32.lib    \
# $(LIB_PATH)/um/x64/ws2_32.lib	 \
# $(LIB_PATH)/um/x64/OleAut32.Lib	 \
# $(LIB_PATH)/um/x64/shlwapi.lib	 \
# $(VS_INCLUDE)/lib/amd64/libcpmt.lib\
# $(VS_INCLUDE)/lib/amd64/libcmt.lib\
# $(VS_INCLUDE)/lib/amd64/oldnames.lib\
# $(LIB_PATH)/um/x64/uuid.lib	 \
# $(LIB_PATH)/um/x64/version.lib	\
# $(VS_INCLUDE)/atlmfc/lib/amd64/atlsn.lib 




# Object files
OBJS = $(PROJECTNAME).obj 
# $(OTK_CPP_SRC)/includes/BasicExcel.obj $(OTK_CPP_SRC)/includes/ExcelFormat.obj

# Linker
LINK = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64\link.exe"
# LINK = link
#Executable applications compiled using WinMain() instead of main() should set the subsystem to windows instead of console.
LINKFLAGS = /subsystem:console  /machine:amd64 /ignore:4049 /ignore:4219 /ignore:4217

$(EXE) :  $(OBJS) 
	@echo Start at `date`
	@echo CPP_SRC = $(CPP_SRC)
	@echo cur_mkfile = $(cur_mkfile)
#Executable applications compiled using WinMain() instead of main() should set the subsystem to windows instead of console.
	$(LINK) /out:$(APP_ROOT)/$(EXE) $(LINKFLAGS) @<<longline.list
$(OBJS) $(LIBS) 
<<	

	@echo Finished at `date`
	del $(OBJS)
	@echo 开始运行...
	@echo off
	"$(APP_ROOT)/$(EXE)"
	
# object dependencies

$(OBJS):  $(CPP_SRC)/$(PROJECTNAME).cpp
	$(CC) $(CFLAGS) $(CPP_SRC)/$(PROJECTNAME).cpp 


launch:
	"$(MAKEDIR)/$(EXE)"


clean :
	del $(OBJS)
	del $(EXE)
	nmake -f $(MAKEFILENAME)


